package com.llb666.shop.user.api.dto;

import com.llb666.shop.user.domain.entity.Users;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 用户登录dto.
 *
 * @author llb666
 */
@Data
@Schema(name = "UserLoginDto", description = "用户登录对象")
public class UserLoginDto {

    @Schema(name = "username", description = "用户名", example = "maYun", requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    @Schema(name = "password", description = "密码", example = "123456", requiredMode = Schema.RequiredMode.REQUIRED)
    private String password;

    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {
        UserLoginDto.Converter INSTANCE = Mappers.getMapper(UserLoginDto.Converter.class);

        Users dto2do(UserLoginDto activity);
    }
}
